<template>
  <el-input
    v-model="value"
    :rows="rows"
    :type="type"
    :placeholder="placeholder"
    @change="(value) => $emit('change', value)"
    size="mini"
    >
    <slot v-for="(item, name) in $slots" :name="name" :slot="name"></slot>
  </el-input>
</template>

<script>

export default {
    props: ['placeholder', 'defaultValue', 'rows', 'type'],
    data() {
        return {
            value: '',
        };
    },
    mounted() {
        this.value = this.defaultValue;
    },
    watch: {
        defaultValue(val) {
            this.value = val;
        }
    }
}
</script>

<style lang="less" scoped>
/deep/ .el-input__inner {
    height: 24px;
    line-height: 24px;
    border-radius: 2px;
}

</style>